package com.glodon.ggzy.fwpt.controller;

import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.glodon.ggzy.core.model.Page;
import com.glodon.ggzy.core.utils.Constants;
import com.glodon.ggzy.core.utils.JsonUtils;
import com.glodon.ggzy.core.utils.PageSearchModel;
import com.glodon.ggzy.core.utils.QuerySupport;
import com.glodon.ggzy.core.utils.Tools;
import com.glodon.ggzy.entity.GgCqTbgg;
import com.glodon.ggzy.entity.GgCqXmGgzy;
import com.glodon.ggzy.entity.GgCqZbcjgg;
import com.glodon.ggzy.entity.GgJsProjectInfo;
import com.glodon.ggzy.entity.GgJsTenderNotice;
import com.glodon.ggzy.entity.GgJsWinningPublic;
import com.glodon.ggzy.entity.GgTdGg;
import com.glodon.ggzy.entity.GgTdGs;
import com.glodon.ggzy.entity.GgZfBulletin;
import com.glodon.ggzy.fwpt.service.ICqjyProjectService;
import com.glodon.ggzy.fwpt.service.IJsgcProjectService;
import com.glodon.ggzy.fwpt.service.ITdfcProjectService;
import com.glodon.ggzy.fwpt.service.IZfcgProjectService;
import com.glodon.ggzy.sso.utils.TimeUtil;
import com.glodon.ggzy.vo.Xxgk;
import com.glodon.ggzy.vo.ZbgsResultVO;
import com.glodon.ggzy.vo.ZfcgInfoVO;

/**
 * 
 * 信息公开处理控制器
 * @author yangjf
 * @date 2013/06/11
 */
@Controller
public class XxgkController {

	protected Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private IJsgcProjectService jsgcProjectService;

	@Autowired
	private ICqjyProjectService cqjyProjectService;

	@Autowired
	private ITdfcProjectService tdfcProjectService;

	@Autowired
	private IZfcgProjectService zfcgProjectService;

	/**
	 * 获取信息公开-建设工程集合
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_page_list")
	public String xxgkJsgcPageList(Model model) {
		return "/fwpt/xxgk_jsgc_page_list";
	}

	/**
	 * 获取信息公开-产权交易集合
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_cqjy_page_list")
	public String xxgkCqjyPageList(Model model) {
		return "/fwpt/xxgk_cqjy_page_list";
	}

	/**
	 * 获取信息公开-产权交易:分页
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_cqjy_page_data")
	public void getXxgkCqjyPageList(Model model, int rows, int page, String prjName, String prjType, HttpServletResponse response) {
		PageSearchModel qm = new PageSearchModel();
		qm.setPageNo(page);
		qm.setPageSize(rows);
		String name = "";
		if (StringUtils.isNotEmpty(prjName)) {
			try {
				name = "%" + URLDecoder.decode(prjName, "UTF-8") + "%";
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
				name = "";
			}
		}
		Page queryPage = null;
		List<Xxgk> resultList = new ArrayList<Xxgk>();
		if ("tbgs".equals(prjType)) {
			qm.addParamToMap(QuerySupport.QUERYCLASS, GgCqTbgg.class);
			qm.addParamToMap(QuerySupport.ORDERBYDESC, "startDate");
			if (StringUtils.isNotEmpty(name)) {
				qm.addParamToMap("name_like", name);
			}
			queryPage = cqjyProjectService.queryPage(qm);
			List<GgCqTbgg> zbggList = (List<GgCqTbgg>) queryPage.getResult();
			Xxgk xx = null;
			for (GgCqTbgg gg : zbggList) {
				String date = gg.getStartDate() == null ? "" : Tools.formatDateToString(gg.getStartDate());
				xx = new Xxgk(gg.getName(), "", gg.getId(), "特别公告", date);
				resultList.add(xx);
			}
		} else if ("zbgs".equals(prjType)) {
			qm.addParamToMap(QuerySupport.QUERYCLASS, GgCqZbcjgg.class);
			qm.addParamToMap(QuerySupport.ORDERBYDESC, "publishDate");
			qm.addParamToMap("publishStatus", "1");
			if (StringUtils.isNotEmpty(name)) {
				qm.addParamToMap("name_like", name);
			}
			queryPage = cqjyProjectService.queryPage(qm);

			List<GgCqZbcjgg> zbggList = (List<GgCqZbcjgg>) queryPage.getResult();
			Xxgk xx = null;
			for (GgCqZbcjgg gg : zbggList) {
				String date = gg.getPublishDate() == null ? "" : Tools.formatDateToString(gg.getPublishDate());
				xx = new Xxgk(gg.getName(), "", gg.getId(), "中标公示", date);
				resultList.add(xx);
			}
		} else {
			qm.addParamToMap(QuerySupport.QUERYCLASS, GgCqXmGgzy.class);
			qm.addParamToMap(QuerySupport.ORDERBYDESC, "gpDate");
			qm.addParamToMap("fb", "1");
			if (StringUtils.isNotEmpty(name)) {
				qm.addParamToMap("pkgName_like", name);
			}
			queryPage = cqjyProjectService.queryPage(qm);

			List<GgCqXmGgzy> zbggList = (List<GgCqXmGgzy>) queryPage.getResult();

			Xxgk xx = null;
			for (GgCqXmGgzy gg : zbggList) {
				String gpDate = gg.getGpDate() == null ? "" : Tools.formatDateToString(gg.getGpDate());
				xx = new Xxgk(gg.getPkgName(), "", gg.getId(), "招标公告", gpDate);
				resultList.add(xx);
			}
		}

		queryPage.setResult(resultList);
		String jsonStr = "";
		try {
			jsonStr = JsonUtils.toJsonStr(queryPage);
			response.getWriter().write(jsonStr);
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	/**
	 * 获取信息公开-土地房产集合
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_tdfc_page_list")
	public String xxgkTdfcPageList(Model model) {
		return "/fwpt/xxgk_tdfc_page_list";
	}

	/**
	 * 获取信息公开-政府采购集合
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_zfcg_page_list")
	public String xxgkZfcgPageList(Model model) {
		return "/fwpt/xxgk_zfcg_page_list";
	}

	/**
	* 获取信息公开-土地房产详情
	* @param model
	* @return
	*/
	@RequestMapping("/fwpt/xxgk_zfcg_detail")
	public String getXxgkZfcgDetail(String id, Model model) {
		GgZfBulletin bulletin = zfcgProjectService.getGgZfBulletinById(id);
		model.addAttribute("bulletin", bulletin);
		return "/fwpt/xxgk_zfcg_detail";
	}

	/**
	* 获取信息公开-产权交易详情
	* type:特别公告、中标公示
	* @param model
	* @return
	*/
	@RequestMapping("/fwpt/xxgk_cqjy_detail")
	public String getXxgkCqjyDetail(String id, String prjType, Model model) {
		if ("zbgs".equals(prjType)) {
			GgCqZbcjgg zbgs = cqjyProjectService.getZbgsById(id);
			model.addAttribute("name", zbgs.getName());
			model.addAttribute("text", zbgs.getText());
		}
		if ("tbgs".equals(prjType)) {
			GgCqTbgg tbgs = cqjyProjectService.getTbggById(id);
			model.addAttribute("name", tbgs.getName());
			model.addAttribute("text", tbgs.getText());
		}
		return "/fwpt/xxgk_cqjy_detail";
	}

	/**
	 * 获取信息公开-建设工程分页
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_page_data")
	public void getXxgk_JsgcPageList(Model model, int rows, int page, String searchText, HttpServletResponse response) {
		//查查参数赋值
		PageSearchModel qm = new PageSearchModel();
		qm.setPageNo(page);
		qm.setPageSize(rows);
		if (!StringUtils.isEmpty(searchText)) {
			try {
				searchText = URLDecoder.decode(searchText, "UTF-8");
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
		}

		Page queryPage = jsgcProjectService.queryJsgcProjectInfo(qm, searchText);
		List<GgJsProjectInfo> projectInfoList = (List<GgJsProjectInfo>) queryPage.getResult();
		List<Xxgk> xxgkList = new ArrayList<Xxgk>();
		for (GgJsProjectInfo projectInfo : projectInfoList) {
			Xxgk xxgk = new Xxgk(projectInfo.getProjectName(), projectInfo.getProjectCode(), projectInfo.getId(),
					jsgcProjectService.getProjectTypeByCode(projectInfo.getProjectType()), null);
			xxgkList.add(xxgk);
		}
		queryPage.setResult(xxgkList);
		String jsonStr = "";
		try {
			jsonStr = JsonUtils.toJsonStr(queryPage);
			response.getWriter().write(jsonStr);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 获取信息公开-政府采购分页
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_zfcg_page_data")
	public void getXxgk_ZfcgPageList(Model model, int rows, int page, String searchText, HttpServletResponse response) {
		//查查参数赋值
		PageSearchModel qm = new PageSearchModel();
		qm.setPageNo(page);
		qm.setPageSize(rows);
		if (!StringUtils.isEmpty(searchText)) {
			try {
				searchText = URLDecoder.decode(searchText, "UTF-8");
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
		}

		Page queryPage = zfcgProjectService.queryZfcgTenderNotice(qm, searchText, Constants.FWPT_XXGK);
		List<GgZfBulletin> noticeList = (List<GgZfBulletin>) queryPage.getResult();
		List<ZfcgInfoVO> xxgkList = new ArrayList<ZfcgInfoVO>();
		for (GgZfBulletin bulletin : noticeList) {
			ZfcgInfoVO xxgk = new ZfcgInfoVO(bulletin.getId(), bulletin.getBulletincode(), bulletin.getBulletinname(), bulletin.getStockmode(),
					bulletin.getBuysarttime());
			xxgkList.add(xxgk);
		}
		queryPage.setResult(xxgkList);
		String jsonStr = "";
		try {
			jsonStr = JsonUtils.toJsonStr(queryPage);
			response.getWriter().write(jsonStr);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 获取信息公开-土地房产分页
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_tdfc_page_data")
	public void getXxgk_TdfcPageList(Model model, String prjType, String prjName, int rows, int page, HttpServletResponse response) {
		PageSearchModel qm = new PageSearchModel();
		qm.setPageNo(page);
		qm.setPageSize(rows);
		String prjTpyeName = "";

		if (StringUtils.isEmpty(prjType)) {

			prjType = "zzjy";
		}

		if ("zzjy".equals(prjType)) {
			prjTpyeName = "正在交易";
		}
		if ("jywc".equals(prjType)) {
			prjTpyeName = "交易完成";
		}
		if ("jyzz".equals(prjType)) {
			prjTpyeName = "交易终止";
		}
		if ("jywcg".equals(prjType)) {
			prjTpyeName = "交易未成功";
		}
		if ("zbgs".equals(prjType)) {
			prjTpyeName = "中标公示";
		}

		String name = "";
		if (StringUtils.isNotEmpty(prjName)) {
			try {
				name = "%" + URLDecoder.decode(prjName, "UTF-8") + "%";
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
				name = "";
			}
		}

		if (!"zbgs".equals(prjType)) {

			if (StringUtils.isNotEmpty(name)) {
				qm.addParamToMap("ggName_like", name);
			}
			qm.addParamToMap("jyStatus", prjTpyeName);

			qm.addParamToMap(QuerySupport.QUERYCLASS, GgTdGg.class);
			qm.addParamToMap(QuerySupport.ORDERBYDESC, "ggUploadtime");
			Page queryPage = tdfcProjectService.queryXxgkTdfcPage(qm);
			List<GgTdGg> prjList = (List<GgTdGg>) queryPage.getResult();

			List<Xxgk> peList = new ArrayList<Xxgk>();

			for (GgTdGg prj : prjList) {
				String returnStr = "<a href='xxgk_tdfc_zbgg_detail.do?id=" + prj.getId() + "'" + " target='_blank' class='a_img'>";
				returnStr += "<img src='../static/images/array.png' style='padding:0 10px 0 10px'/>" + prj.getGgName();
				returnStr += "</a>";

				Xxgk xx = new Xxgk(returnStr, "", prj.getId(), prj.getJyStatus(), null);
				peList.add(xx);
			}

			queryPage.setResult(peList);

			String jsonStr = "";
			try {
				jsonStr = JsonUtils.toJsonStr(queryPage);
				response.getWriter().write(jsonStr);
			} catch (IOException e) {
				e.printStackTrace();
			}
		} else {
			if (StringUtils.isNotEmpty(name)) {
				qm.addParamToMap("gsName_like", name);
			}
			qm.addParamToMap(QuerySupport.QUERYCLASS, GgTdGs.class);

			Page queryPage = tdfcProjectService.queryXxgkTdfcPage(qm);
			List<GgTdGs> prjList = (List<GgTdGs>) queryPage.getResult();

			List<Xxgk> peList = new ArrayList<Xxgk>();

			for (GgTdGs prj : prjList) {
				String returnStr = "<a href='zbgs_tdfc_detail.do?id=" + prj.getId() + "'" + " target='_blank' class='a_img'>";
				returnStr += "<img src='../static/images/array.png' style='padding:0 10px 0 10px'/>" + prj.getGsName();
				returnStr += "</a>";

				Xxgk xx = new Xxgk(returnStr, prj.getGsNo(), prj.getId(), "中标公示", null);
				peList.add(xx);
			}

			queryPage.setResult(peList);

			String jsonStr = "";
			try {
				jsonStr = JsonUtils.toJsonStr(queryPage);
				response.getWriter().write(jsonStr);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

	}

	/**
	 * 获取信息公开-土地房产
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_tdfc_detail")
	public String getXxgkTdfcDetail(String id, String subSysType, String liuchengType, Model model) {
		return "/fwpt/xxgk_tdfc_detail";
	}

	/**
	 * 获取信息公开-建设工程-招标公告详情
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_zbgg")
	public String getXxgkJsgcZbgg(String id, Model model) {
		String retUrl = "";
		GgJsProjectInfo projectInfo = jsgcProjectService.getGgJsProjectInfoById(id);
		GgJsTenderNotice tenderNotice = jsgcProjectService.getGgJsTenderNoticeByProjId(id);
		if (projectInfo != null && !StringUtils.isEmpty(projectInfo.getId())) {
			projectInfo.setProjectType(jsgcProjectService.getProjectTypeByCode(projectInfo.getProjectType()));
			projectInfo.setJointBidding(jsgcProjectService.getJointBiddingByCode(projectInfo.getJointBidding()));
		}
		model.addAttribute("projectInfo", projectInfo);
		model.addAttribute("tenderNotice", tenderNotice);
		model.addAttribute("id", id);
		model.addAttribute("liuchengType", "zbgg");
		if (tenderNotice != null) {
			if (tenderNotice.getNoticeType().equals("zbgg")) {
				retUrl = "/fwpt/xxgk_jsgc_zbgg";
			} else if (tenderNotice.getNoticeType().equals("fjczbgg")) {
				retUrl = "/fwpt/xxgk_jsgc_fjczbgg";
			} else {
				retUrl = "/fwpt/xxgk_jsgc_zbgg";
			}
		}
		return retUrl;
	}

	/**
	 * 获取信息公开-建设工程-招标文件答疑详情
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_zbwjdy")
	public String getXxgkJsgcZbwjdy(String id, Model model) {
		GgJsProjectInfo projectInfo = jsgcProjectService.getGgJsProjectInfoById(id);
		GgJsTenderNotice tenderNotice = jsgcProjectService.getGgJsTenderNoticeByIdAndType(id, "zbwjdy");
		model.addAttribute("projectInfo", projectInfo);
		model.addAttribute("tenderNotice", tenderNotice);
		model.addAttribute("id", id);
		model.addAttribute("liuchengType", "zbwjdy");
		return "/fwpt/xxgk_jsgc_zbwjdy";
	}

	/**
	 * 获取信息公开-建设工程-招标文件修改详情
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_zbwjxg")
	public String getXxgkJsgcZbejxg(String id, Model model) {
		GgJsProjectInfo projectInfo = jsgcProjectService.getGgJsProjectInfoById(id);
		GgJsTenderNotice tenderNotice = jsgcProjectService.getGgJsTenderNoticeByIdAndType(id, "zbwjxg");
		model.addAttribute("projectInfo", projectInfo);
		model.addAttribute("tenderNotice", tenderNotice);
		model.addAttribute("id", id);
		model.addAttribute("liuchengType", "zbwjxg");
		return "/fwpt/xxgk_jsgc_zbwjxg";
	}

	/**
	 * 获取信息公开-建设工程-中标公示详情
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_zbgs")
	public String getXxgkJsgcZbgs(String id, Model model) {
		GgJsProjectInfo projectInfo = jsgcProjectService.getGgJsProjectInfoById(id);
		GgJsWinningPublic winningPublic = jsgcProjectService.getGgJsWinningPublicByProjId(id);
		model.addAttribute("projectInfo", projectInfo);
		model.addAttribute("winningPublic", winningPublic);
		model.addAttribute("id", id);
		model.addAttribute("liuchengType", "zbgs");
		return "/fwpt/xxgk_jsgc_zbgs";
	}

	/**
	 * 获取信息公开-招标公告-土地房产

	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_xmts")
	public String getXxgkJsgcXmts(String id, Model model, HttpServletResponse response) {
		GgJsProjectInfo projectInfo = jsgcProjectService.getGgJsProjectInfoById(id);
		GgJsTenderNotice tenderNotice = jsgcProjectService.getGgJsTenderNoticeByIdAndType(id, "xmts");
		model.addAttribute("projectInfo", projectInfo);
		model.addAttribute("tenderNotice", tenderNotice);
		model.addAttribute("id", id);
		if (tenderNotice != null && !StringUtils.isEmpty(tenderNotice.getId())) {
			model.addAttribute("noticeId", tenderNotice.getId());
		}
		model.addAttribute("liuchengType", "xmts");
		return "/fwpt/xxgk_jsgc_xmts";
	}

	/**
	 * 
	 * 信息公开-土地房产-招标公告详情
	 * @param id
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_tdfc_zbgg_detail")
	public String getXxgkTdfcZbggDetail(String id, Model model) {
		//		//写业务逻辑
		//		List<GgTdProjItem> list = tdfcProjectService.queryGgTdProItemsById(id);
		//		String remark = "无";
		//
		//		String gp_zd = "";
		//
		//		for (int i = 0; i < list.size(); i++) {
		//
		//			GgTdProjItem ggTdProjItem = list.get(i);
		//
		//			gp_zd += ggTdProjItem.getGpxhZdbh();
		//
		//			if (i < list.size() - 1)
		//				gp_zd = gp_zd + "、";
		//
		//			if (StringUtils.isEmpty(ggTdProjItem.getBz()))
		//				continue;
		//
		//			remark = ggTdProjItem.getBz();
		//
		//		}
		//
		//获取公告信息
		GgTdGg notice = tdfcProjectService.queryGgTdGgByProId(id);
		//
		//		model.addAttribute("id", id);
		//		//标地明细
		//		model.addAttribute("list", list);
		//		model.addAttribute("remark", remark);
		//		//公告
		//		model.addAttribute("notice", notice);
		//		//挂牌序号
		//		model.addAttribute("gp_zd", gp_zd);
		//
		//		//公告发布日期
		//		model.addAttribute("publicDate", TimeUtil.DateToCN(notice.getGgUploadtime()));
		model.addAttribute("detail", notice.getGgText());

		return "/fwpt/xxgk_tdfc_zbgg_detail";
	}

	/**
	 * 获取信息公开-中标公示-土地房产
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_tdfc_zbgs_detail")
	public String getXxgkTdfcZbgsDetail(String id, Model model) {

		//写业务逻辑
		List<ZbgsResultVO> queryZbgsResult = tdfcProjectService.queryZbgsResultList(id);

		//获取公告信息
		GgTdGg notice = tdfcProjectService.queryGgTdGgByProId(id);

		GgTdGs ggTdGs = tdfcProjectService.queryGgTdGsByProId(id);

		model.addAttribute("id", id);
		model.addAttribute("gpEndtime", TimeUtil.DateToCN(notice.getGpEndtime()));
		model.addAttribute("gsUploadtime", TimeUtil.DateToCN(ggTdGs.getGsUploadtime()));
		model.addAttribute("list", queryZbgsResult);

		return "/fwpt/xxgk_tdfc_zbgs_detail";
	}

	/**
	 * 
	 * 获取信息公开-建设工程-图片链接
	 * @param model
	 * @param id
	 * @param response
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_img")
	public void getXxgkJsgcImg(Model model, String id, HttpServletResponse response) {
		GgJsTenderNotice tenderNotice = jsgcProjectService.getGgJsTenderNoticeById(id);
		OutputStream outStream;
		try {
			outStream = response.getOutputStream();
			outStream.write(tenderNotice.getNoticeImage(), 0, tenderNotice.getNoticeImage().length);
			outStream.flush();
			outStream.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 获取信息公开-建设工程-投诉处理决定详情
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_tscljd")
	public String getXxgkJsgcTscljd(String id, Model model, HttpServletResponse response) {
		GgJsProjectInfo projectInfo = jsgcProjectService.getGgJsProjectInfoById(id);
		GgJsTenderNotice tenderNotice = jsgcProjectService.getGgJsTenderNoticeByIdAndType(id, "tscljd");
		model.addAttribute("projectInfo", projectInfo);
		model.addAttribute("tenderNotice", tenderNotice);
		model.addAttribute("id", id);
		if (tenderNotice != null && !StringUtils.isEmpty(tenderNotice.getId())) {
			model.addAttribute("noticeId", tenderNotice.getId());
		}
		model.addAttribute("liuchengType", "tscljd");
		return "/fwpt/xxgk_jsgc_tscljd";
	}

	/**
	 * 获取信息公开-建设工程-项目通知详情
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_xmtz")
	public String getXxgkJsgcXmtz(String id, Model model, HttpServletResponse response) {
		GgJsProjectInfo projectInfo = jsgcProjectService.getGgJsProjectInfoById(id);
		GgJsTenderNotice tenderNotice = jsgcProjectService.getGgJsTenderNoticeByIdAndType(id, "xmtz");
		model.addAttribute("projectInfo", projectInfo);
		model.addAttribute("tenderNotice", tenderNotice);
		model.addAttribute("id", id);
		if (tenderNotice != null && !StringUtils.isEmpty(tenderNotice.getId())) {
			model.addAttribute("noticeId", tenderNotice.getId());
		}
		model.addAttribute("liuchengType", "xmtz");
		return "/fwpt/xxgk_jsgc_xmtz";
	}

	/**
	 * 获取信息公开-建设工程-项目延期详情
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_xmyq")
	public String getXxgkJsgcXmyq(String id, Model model) {
		GgJsProjectInfo projectInfo = jsgcProjectService.getGgJsProjectInfoById(id);
		GgJsTenderNotice tenderNotice = jsgcProjectService.getGgJsTenderNoticeByIdAndType(id, "xmyq");
		model.addAttribute("projectInfo", projectInfo);
		model.addAttribute("tenderNotice", tenderNotice);
		model.addAttribute("id", id);
		model.addAttribute("liuchengType", "xmyq");
		return "/fwpt/xxgk_jsgc_xmyq";
	}

	/**
	 * 获取信息公开-建设工程-招标中止详情
	 * @param model
	 * @return
	 */
	@RequestMapping("/fwpt/xxgk_jsgc_zbzz")
	public String getXxgkJsgcZbzz(String id, Model model) {
		GgJsProjectInfo projectInfo = jsgcProjectService.getGgJsProjectInfoById(id);
		GgJsTenderNotice tenderNotice = jsgcProjectService.getGgJsTenderNoticeByIdAndType(id, "zbzz");
		model.addAttribute("projectInfo", projectInfo);
		model.addAttribute("tenderNotice", tenderNotice);
		model.addAttribute("id", id);
		model.addAttribute("liuchengType", "zbzz");
		return "/fwpt/xxgk_jsgc_zbzz";
	}

}
